/**
 * 
 */
package com.movieproject.src;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.movieproject.daos.InventoryDAO;
import com.movieproject.daos.MovieDAO;
import com.movieproject.daos.QueueDAO;
import com.movieproject.dataobjects.Movie;


/**
 * @author lpearson
 *
 */
@Controller
@Transactional
public class ReportsController 
{
	@Autowired
	InventoryDAO inventoryDAO;

	@Autowired
	QueueDAO queueDAO;

	@Autowired
	MovieDAO movieDAO;

	@RequestMapping(value = "reports", method=RequestMethod.GET)
	public ModelAndView reports()
	{

		ModelAndView m = new ModelAndView();

		m.getModelMap().addAttribute("inventorylist", inventoryDAO.getItemsInStock());

		return m;		
	}
	//This mapping will be used to generate a list of all users and their Queues
	@RequestMapping(value="userQueues", method=RequestMethod.GET)
	public ModelAndView userQueues()
	{
		ModelAndView m = new ModelAndView();
		m.getModelMap().addAttribute("userQueueReport", queueDAO.getAllQueues());

		return m;
	}	
	//links to popular movie report.  used for 
	@RequestMapping(value = "popularMovieReport", method=RequestMethod.GET)
	public String popularMoviePage(Model model)
	{
		return "popularMovieReport";		
	}




}
